<?php
/**
 * Created by PhpStorm.
 * User: Inhere
 * Date: 2015/2/24
 * Time: 10:13
 * Use :
 * File: ErrorController.php
 */

namespace app\controllers;


use ulue\web\Controller;

class ErrorController extends Controller
{
    // route: /dev.php/error/error
    public function errorAction()
    {
        vd($this->path, $this->getFile());
        \Trigger::error('用 Trigger::error() 手动抛出错误！');
    }

    // route: /dev.php/error/t_error
    public function t_errorAction()
    {
        vd($this->path, $this->getFile());
        trigger_error('用 trigger_error() 手动抛出错误！', E_USER_ERROR);
    }

    // route: /dev.php/error/notice
    public function noticeAction()
    {
        \Trigger::notice('用 Trigger::notice() 手动抛出提示！');
        vd($this->path, $this->getFile(), -4);
    }

    // route: /dev.php/error/t_notice
    public function t_noticeAction()
    {
        trigger_error('用 trigger_error() 手动抛出提示！');
        vd($this->path, $this->getFile(), -4);
    }


    // route: /dev.php/error/exception
    public function exceptionAction()
    {
        vd($this->path, $this->getFile());
        // throw new \DRuntimeException('用 \DRuntimeException 抛出“运行”异常！');
        throw new \DInvalidArgumentException('用 \DInvalidArgumentException 抛出“无效参数”异常！');
        // throw new \DNotFoundException('用 \DNotFoundException 抛出“没有找到”异常！');
        // throw new \DUnknownCalledException('用 \DUnknownCalledException 抛出"错误调用"异常！');
        // 更多请看 /vendor/ulue/libs/debug/driver 目录
    }




}// end class ErrorController